<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改申报系统')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-declare-edit" th:object="${lhqDeclare}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">课题名称：</label>
                <div class="col-sm-8">
                    <input name="projectTitle" th:field="*{projectTitle}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">申报年度：</label>
                <div class="col-sm-8">
                    <select name="declareTheAnnual" class="form-control m-b" th:with="type=${@dict.getType('sys_year')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{declareTheAnnual}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">研究类型：</label>
                <div class="col-sm-8">
                    <select name="researchType" class="form-control m-b" th:with="type=${@dict.getType('sys_research_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{researchType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">负责人：</label>
                <div class="col-sm-8">
                    <input name="principal" th:field="*{principal}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">行政职务：</label>
                <div class="col-sm-8">
                    <select name="administrativePost" class="form-control m-b" th:with="type=${@dict.getType('sys_administrativ_service')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{administrativePost}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">专业职务：</label>
                <div class="col-sm-8">
                    <select name="professionalDuties" class="form-control m-b" th:with="type=${@dict.getType('sys_duties')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{professionalDuties}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">最高学历：</label>
                <div class="col-sm-8">
                    <select name="officialAcademicCredentials" class="form-control m-b" th:with="type=${@dict.getType('sys_education')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{officialAcademicCredentials}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">最高学位：</label>
                <div class="col-sm-8">
                    <select name="theHighestDegree" class="form-control m-b" th:with="type=${@dict.getType('sys_degree')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{theHighestDegree}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">电子邮箱：</label>
                <div class="col-sm-8">
                    <input name="emailAddress" th:field="*{emailAddress}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">联系电话：</label>
                <div class="col-sm-8">
                    <input name="contactNumber" th:field="*{contactNumber}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">申请书：</label>
                <div class="col-sm-8">
                    <input type="hidden" name="applicationForm" th:field="*{applicationForm}">
                    <div class="file-loading">
                        <input class="form-control file-upload" id="applicationForm" name="file" type="file">
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">活页：</label>
                <div class="col-sm-8">
                    <input type="hidden" name="leaflet" th:field="*{leaflet}">
                    <div class="file-loading">
                        <input class="form-control file-upload" id="leaflet" name="file" type="file">
                    </div>
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">第一次审批状态：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <select name="firstApprovalStatus" class="form-control m-b" th:with="type=${@dict.getType('sys_status')}">-->
<!--                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{firstApprovalStatus}"></option>-->
<!--                    </select>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">开题报告：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input type="hidden" name="thesisProposal" th:field="*{thesisProposal}">-->
<!--                    <div class="file-loading">-->
<!--                        <input class="form-control file-upload" id="thesisProposal" name="file" type="file">-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">第二次审批状态：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <select name="secondApprovalStatus" class="form-control m-b" th:with="type=${@dict.getType('sys_status')}">-->
<!--                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{secondApprovalStatus}"></option>-->
<!--                    </select>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">中期报告：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input type="hidden" name="interimReport" th:field="*{interimReport}">-->
<!--                    <div class="file-loading">-->
<!--                        <input class="form-control file-upload" id="interimReport" name="file" type="file">-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">第三次审批状态：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <select name="thirdApprovalStatus" class="form-control m-b" th:with="type=${@dict.getType('sys_status')}">-->
<!--                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{thirdApprovalStatus}"></option>-->
<!--                    </select>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">结题报告：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input type="hidden" name="closingReport" th:field="*{closingReport}">-->
<!--                    <div class="file-loading">-->
<!--                        <input class="form-control file-upload" id="closingReport" name="file" type="file">-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">变更申请书：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input type="hidden" name="applicationForAlteration" th:field="*{applicationForAlteration}">-->
<!--                    <div class="file-loading">-->
<!--                        <input class="form-control file-upload" id="applicationForAlteration" name="file" type="file">-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">第四次审批状态：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <select name="fourthApprovalStatus" class="form-control m-b" th:with="type=${@dict.getType('sys_status')}">-->
<!--                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{fourthApprovalStatus}"></option>-->
<!--                    </select>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">上传作者：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="chinappt" th:field="*{chinappt}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">关联id：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="userId" th:field="*{userId}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">创建时间：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <div class="input-group date">-->
<!--                        <input name="creationTime" th:value="${#dates.format(lhqDeclare.creationTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">-->
<!--                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: bootstrap-fileinput-js"/>
    <script th:inline="javascript">
        var prefix = ctx + "ruoyi/declare";
        $("#form-declare-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-declare-edit').serialize());
            }
        }

        $("input[name='creationTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $(".file-upload").each(function (i) {
            var val = $("input[name='" + this.id + "']").val()
            $(this).fileinput({
                'uploadUrl': '/common/upload',
                initialPreviewAsData: true,
                initialPreview: [val],
                maxFileCount: 1,
                autoReplace: true
            }).on('fileuploaded', function (event, data, previewId, index) {
                $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
            }).on('fileremoved', function (event, id, index) {
                $("input[name='" + event.currentTarget.id + "']").val('')
            })
            $(this).fileinput('_initFileActions');
        });
    </script>
</body>
</html>